﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace RuneLogLoader
{
    class RuneLogLoader
    {
        PageLoader loader;
        DatabaseWriter writer;

        public RuneLogLoader()
        {
            writer = new DatabaseWriter();
            loader = new PageLoader();
            loader.PageLoaded += new PageLoadedEventHandler(loader_PageLoaded);
            loader.StartLoading();
        }

        void loader_PageLoaded(object sender, PageLoadedEventArgs e)
        {
            writer.WriteToDatabase(e.ItemInfo);
            foreach (var kvp in e.ItemInfo)
                Console.WriteLine("{0}: {1}", kvp.Key, kvp.Value);
        }
    }
}
